{extend name="layout" /}
{block name="content"}
<div class="layui-tab layui-tab-brief">
	<ul class="layui-tab-title">
	    <li><a href="{:url('level')}">{$pathCurrent['name']}</a></li>
	    <li class="layui-this">{empty name="info"}新增{else /}编辑{/empty}等级</li>
  	</ul>
</div>
<div class="layui-card-body">
	<form class="layui-form" data-model="form-submit">
		<div class="layui-form-item">
			<label class="layui-form-label">上级代理</label>
			<div class="layui-input-block">
				<select name="parent_id" lay-filter="aihao">
					<option value="0">一级代理</option>
					{foreach $group as $vo}
	           		<option value="{$vo['id']}" {if $vo['id'] eq $info['parent_id']}selected=""{/if}>{$vo['name']}</option>
	           		{/foreach}
				</select>
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">等级名称</label>
			<div class="layui-input-block">
				<input type="text" class="layui-input" name="name" value="{$info['name']}" datatype="*">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">等级门槛</label>
			<div class="layui-input-block">
				<input type="text" class="layui-input" name="money" value="{$info['money']}" datatype="*">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">需推荐人数</label>
			<div class="layui-input-block">
				<input type="text" class="layui-input" name="people" value="{$info['people']}" datatype="*">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">推荐奖励单价</label>
			<div class="layui-input-block">
				<input type="text" class="layui-input" name="reward" value="{$info['reward']}" datatype="*">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">推荐结算周期</label>
			<div class="layui-input-block">
				<select name="month">
					<option value="0" {if $info['month'] eq 0}selected{/if}>无结算机制</option>
					<option value="1" {if $info['month'] eq 1}selected{/if}>一个月（自然月）</option>
					<option value="2" {if $info['month'] eq 2}selected{/if}>两个月（自然月）</option>
					<option value="3" {if $info['month'] eq 3}selected{/if}>三个月（自然月）</option>
					<option value="4" {if $info['month'] eq 4}selected{/if}>四个月（自然月）</option>
					<option value="5" {if $info['month'] eq 5}selected{/if}>五个月（自然月）</option>
					<option value="6" {if $info['month'] eq 6}selected{/if}>六个月（自然月）</option>
				</select>
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">证书图片</label>
			<div class="layui-input-block">
				<input type="hidden" class="layui-input" name="auth_book_image" id="image" datatype="*" nullmsg="请上传app_logo" value="{$info['auth_book_image'] ?? ''}">
				<button class="layui-btn layui-btn-warm" type="button" data-model="form-upload" data-target="#image" data-preview="#uploadImage_2">上传图片</button>
			</div>
			<div class="layui-input-block">
				<div class="upload-prview">
					<img style="width:expression(this.width > 105 ? 105px : this.width)" src="{$info['auth_book_image'] ?? ''}" id="uploadImage_2">
				</div>
				<div class="layui-form-mid layui-word-aux">(推荐尺寸为640px*896px,支持jpeg、jpg、png、gif、jpeg格式)</div>
			</div>
		</div>
		<div class="layui-form-item">
	    	<div class="layui-input-block">
	    		<input type="hidden" name="id" value="{$info['id']}">
	      		<button class="layui-btn layui-btn-normal">保存</button>
	      		<button type="reset" class="layui-btn layui-btn-primary">重置</button>
	    	</div>
	  	</div>
	</form>
</div>
{/block}
{block name="js"}
<script type="text/javascript">
var mixin = {};
layui.use('form',function(){
	var form = layui.form
});
</script>
{/block}